<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录-加工单</title>
    <link rel="stylesheet" href="css/Font-Awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/layui-v2.2.5/css/layui.css">
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" type="text/css" href="css/user.css">
</head>
<body style="background:#000;">
<div class="logo_wal">
    <div class="regist">
        <span>还没有帐号？</span>
        <span>
					<input type="submit" value="立即注册" />
				</span>
        <span class="want">我要购物？<a href="#">加入嗅色</a></span>
    </div>
    <div class="img_fl left"></div>
    <div class="login_fr left">
        <div class="login_input" id="loginMain">
            <h1>欢迎来到兜兜</h1>

                <dl class="lg">
                    <dt><h3>手机号</h3></dt>
                    <dd class="clearfix">
                        <input type="text" class="phone" placeholder="请输入手机号" v-model="phone"/>
                    </dd>
                    <dt><h3>密码</h3></dt>
                    <dd class="clearfix">
                        <input type="password" class="password" placeholder="请输入密码" v-model="passWord" />
                    </dd>
                    <dd class="clearfix">
                        <input type="button" @click="login" class="submit left" value="登 录" />
                        <span class="wx left"><a href="#">微信登录</a></span>
                    </dd>
                </dl>

        </div>
        <div class="login_foot">
            <span><a href="#">关于兜兜</a></span>
            <span><a href="#">新手教程</a></span>
            <span><a href="#">城市合伙人</a></span>
            <span><a href="#">京ICP备17055083号-2</a></span>
        </div>
    </div>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script>
    new Vue({
        el:"#loginMain",
        data:{
            phone:"",
            passWord:""
        },
        methods:{
            login:function () {
                $.ajax({
                    url:"/loginIn.htmls",
                    type:"post",
                    data:{
                        phone:this.phone,
                        passWord:this.passWord
                    },
                    dataType:"json",
                    success:function (d) {
                        if(d.code==0){
                            if(d.msg=="admin"){
                                window.location.href="/adminIndex.htmls";
                            }else{
                                window.location.href="/index.htmls";
                            }
                        }else{
                            alert("登录失败");
                        }
                    }
                })
            }
        }
    })
</script>
</body>
</html>

